package com.annotation;

public class User {
	@NotNullAnnotation(validator = true,message = ":id格式不正确")
	private String id;
	@NotNullAnnotation(validator = false,message = ":name格式错误")
	private String name;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public User(String id, String name) {
		this.id = id;
		this.name = name;
	}

	public static void main(String[] args){
		User user1 = new User("111","张三");
		User user2 = new User("","李四");
		try {
			AnnotationValidatorUtils.validator(user1);
			AnnotationValidatorUtils.validator(user2);
		} catch (AnnotationValidatorException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
